﻿using DataTransfer.SDK;
using DataTransfer.SDK.Models;
using MiniFox.Components;
using MiniFox.Platform.Applications.Auth;

namespace DataTransfer.Core.Services
{
    /// <summary>
    /// 写数据
    /// </summary>
    [AutoRegister, SpareComponent(typeof(DefaultDataWriter))]
    public abstract class DataWriter : Component
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="setting"></param>
        /// <param name="authStateManagement"></param>
        protected DataWriter(IImporter importer, IAuthStateManagement authStateManagement)
        {
            Importer = importer;
            AuthStateManagement = authStateManagement;
            Name = importer.Name;
        }

        protected IImporter Importer { get; }

        protected IAuthStateManagement AuthStateManagement { get; }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="originalData"></param>
        /// <returns></returns>
        public abstract SummaryModel[] ExecuteWrite(object originalData);

    }

}
